package com.example.yian.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.yian.entity.CaptchaEntity;
import com.example.yian.entity.TextSearchResponse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CaptchaEntityMapper extends BaseMapper<CaptchaEntity> {
    @Select("SELECT * FROM captcha WHERE code = #{strCode}")
    CaptchaEntity selectByCode(String strCode);

    @Select("SELECT * FROM captcha WHERE binduserid = #{userId}")
    CaptchaEntity selectByUserId(Long userId);

    @Update("UPDATE captcha SET binduserid = #{userId} WHERE code = #{code}")
    int updateBindUserId(@Param("userId") Long userId, @Param("code") String code);
}
